Vox A performant static site generator built to scale.

⟵ Guide

Rendering Pipeline

Vox’s rendering pipeline centres around the directed acyclic graph (DAG) data structure. Builds begin with constructing a DAG where the children of pages are their layouts (a layout appearing in the DAG as often as it was used), and the parents of non-layout pages are the pages in the collections they depend on. As an illustrative example, the DAG of this site looks like the following:

Then, pages are rendered recursively, with every root page (ie, every page without any parents) having its descendants rendered.

When changes are made, rebuilding can be done selectively:

  1. A new DAG is constructed.
  2. The difference is obtained between the old and new DAGs.
    • A page is considered modified if it has the same path, but its page is different (not comparing url or rendered).
      • If a node’s page is the same (excluding url or rendered), it is unchanged.
    • A page is considered added if its path appears in the new DAG, but not the old one.
    • A page is considered removed if its path appears in the old DAG, but not the new one.
  3. A list of pages needing rendering is computed.
    • All pages that were modified need to be rendered.
      • Their descendants in the new DAG also need to be rendered.
      • If the page is a layout, its parents in the new DAG need to be rendered.
    • All pages that were added need to be rendered.
      • Their descendants in the new DAG also need to be rendered.
    • All pages that were removed need their descendants in the new DAG rendered.
      • If the page is a layout, its parents in the new DAG also need to be rendered.
  4. The DAGs are merged.
    • In the new DAG, all pages not needing rendering are replaced with their rendered counterparts from the old DAG.
  5. Pages are rendered.